<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('fang'); 

$lpid= isset($_GET['lpid']) ?  $_GET['lpid'] : '-1';

$js_str="";
if($cfg_adminlevel == 1){
	$js_str="XuanLouPan(this.value,'hxid');";
}else{
	$lpid=$_SESSION['lpid'];
	$js_str="XuanLouPan(".$lpid.",'hxid');";
}


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>添加房间信息</title>

<link href="templates/style/admin.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="templates/js/jquery.min.js"></script>

<script type="text/javascript" src="templates/js/getuploadify.js"></script>

<script type="text/javascript" src="templates/js/checkf.func.js"></script>

<script type="text/javascript" src="templates/js/getjcrop.js"></script>

<script type="text/javascript" src="templates/js/getinfosrc.js"></script>

<script type="text/javascript" src="templates/js/getHuxing.js"></script>

<script type="text/javascript" src="plugin/colorpicker/colorpicker.js"></script>

<script type="text/javascript" src="plugin/calendar/calendar.js"></script>

<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->

<link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css">

<link rel="stylesheet" href="/bootstrap/css/bootstrap-theme.min.css" >

<script src="/bootstrap/js/bootstrap.min.js" ></script>

<body>

<div class="container-fluid">

<div class="formHeader"> <span class="title">添加房间信息</span> <a href="javascript:location.reload();" class="reload">刷新</a> </div>

<form name="form" id="form" method="post" action="fang_save.php" onsubmit="return cfm_infolm();">

<p class="bg-primary m10 p10">单个添加房间，请确保该房间没有在批量添加房间中添加过。如果在批量添加过，请尝试修改该房间，无需单独添加。</p>

	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="formTable">

		<tr>

			<td width="25%" height="40" align="right">所属楼盘：</td>

			<td width="75%">

			  <select name="lpid" id="lpid"  onchange="XuanLouPan(this.value,'hxid');">

					<option value="-1">请选择楼盘</option>

					<?php

					//权限验证

					if($cfg_adminlevel == 1)

					{

						$dosql->Execute("SELECT * FROM `#@__loupan`  WHERE `checkinfo`='true' AND delstate='' ");

					}else{

						$lpid=$cfg_lpid;

						$dosql->Execute("SELECT * FROM `#@__loupan`  WHERE `checkinfo`='true' AND delstate='' AND id=$lpid ");

					}

					while($row2 = $dosql->GetArray())

					{

						if($lpid == $row2['id'])

							$selected = 'selected="selected"';

						else

							$selected = '';

							

						echo '<option value="'.$row2['id'].'" '.$selected.'>'.$row2['title'].'</option>';

					}

					?>

				</select>

				<span class="maroon">*</span><span class="cnote">带<span class="maroon">*</span>号表示为必填项</span></td>

		</tr>

		<tr>

			<td height="40" align="right"> 楼号：</td>

			<td><input type="text" name="louhao" id="louhao" class="input " /><span class="maroon">*</span></td>

		</tr>

		<tr>

			<td height="40" align="right">单元号：</td>

			<td><input type="text" name="danyuan" id="danyuan" class="input" /><span class="maroon">*</span></td>

		</tr>

		<tr>

			<td height="40" align="right">楼层：</td>

			<td><input type="text" name="louceng" id="louceng" class="input" /><span class="maroon">*</span></td>

		</tr>

		<tr>

			<td height="40" align="right">房间号：</td>

			<td><input type="text" name="fanghao" id="fanghao" class="input" /><span class="maroon">*</span>该房间在该楼层的号码。10层1号房间 请填写1.  非房间在房管局系统的房号</td>

		</tr>

		<tr>

			<td height="40" align="right">户型图：</td>

			<td>

			  <select name="hxid" id="hxid"  onchange="XuanHuXing(this.value);">

					<option value="-1">请选择该楼盘户型图</option>
					<?php
                    if($cfg_adminlevel != 1){
						$dosql->Execute("SELECT * FROM `#@__huxing`  WHERE `checkinfo`='true' AND delstate='' AND lpid=$lpid ");
						while($row2 = $dosql->GetArray())
						{
	
							echo '<option value="'.$row2['id'].'" >'.GetLouPanName($lpid)."-".$row2['title'].'</option>';
	
						}

					}
					
					?>
			  </select>

            

            <span class="maroon">*</span></td>

		</tr>

		<tr >

			<td height="200" align="right">户型信息：</td>

			<td>

					<div class="result" id="result"></div>

			</td>

		</tr>

		<tr class="nb">

			<td height="40" align="right"> 已售：</td>

			<td><input type="radio" name="is_sale" value="true"   />

				是 &nbsp;

				<input type="radio" name="is_sale" value="false"  checked="checked" />

				否<span class="cnote">选择“否”为在售，“是”为售出</span></td>

		</tr>

		<tr>

			<td height="40" align="right">排列排序：</td>

			<td><input type="text" name="orderid" id="orderid" class="inputos" value="<?php echo GetOrderID('#@__loupan'); ?>" /></td>

		</tr>

		<tr>

			<td height="40" align="right">更新时间：</td>

			<td><input name="posttime" type="text" id="posttime" class="inputms" value="<?php echo GetDateTime(time()); ?>" readonly="readonly" />

				<script type="text/javascript">

				date = new Date();

				Calendar.setup({

					inputField     :    "posttime",

					ifFormat       :    "%Y-%m-%d %H:%M:%S",

					showsTime      :    true,

					timeFormat     :    "24"

				});

				</script></td>

		</tr>

		<tr>

			<td height="40" align="right">发布：</td>

			<td><input type="text" name="author" id="author" value="<?php echo GetAuthor(); ?>" class="input" /></td>

		</tr>

		<tr class="nb">

			<td height="40" align="right">审　核：</td>

			<td><input type="radio" name="checkinfo" value="true" checked="checked"  />

				是 &nbsp;

				<input type="radio" name="checkinfo" value="false" />

				否<span class="cnote">选择“否”则该信息暂时不显示在前台</span></td>

		</tr>

	</table>

	<div class="formSubBtn">

		<input type="submit" class="btn btn-success" value="提交" />

		<input type="button" class="back" value="返回" onclick="history.go(-1);" />

		<input type="hidden" name="action" id="action" value="add" />

	</div>

</form>

</div>

</body>

</html>